package com.jxb.netty.network.netty.splice.linebase;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;

public class Test {

    public static void main(String[] args) {
//        String resp = "Hello,"+"123"+". Welcome to Netty World!"
//                + System.getProperty("line.separator")+"123456";
//        ByteBuf byteBuf = Unpooled.copiedBuffer(resp.getBytes());
//        String s = byteBuf.toString(CharsetUtil.UTF_8);
//        System.out.println(s);


        ByteBuf msg = null;
        String request = "Mark,Lison,King,James,Deer"
                + System.getProperty("line.separator")+"123";
        for(int i=0;i<10;i++){
            msg = Unpooled.buffer(request.length());
            msg.writeBytes(request.getBytes());
            System.out.println(msg.toString(CharsetUtil.UTF_8));
        }
    }
}
